<?php

declare(strict_types=1);

namespace App\Exception;

use App\Http\Common\Result;
use App\Http\Common\ResultCode;
use Hyperf\Server\Exception\ServerException;

class BusinessException extends ServerException
{
    private Result $response;

    public function __construct(string $message = null)
    {
        $this->response = new Result(ResultCode::FAIL, $message);
    }

    public function getResponse(): Result
    {
        return $this->response;
    }
}
